package com.capa.model

data class DeepSeekResponse(
    val id: String,
    val choices: List<Choice>,
    val created: Long,
    val model: String,
    val system_fingerprint: String?,
    val `object`: String,
    val usage: Usage
) {
    data class Choice(
        val finish_reason: String,
        val index: Int,
        val message: Message,
        val logprobs: Logprobs?
    )

    data class Message(
        val content: String,
        val reasoning_content: String?,
        val tool_calls: List<ToolCall>?,
        val role: String
    )

    data class ToolCall(
        val id: String,
        val type: String,
        val function: Function
    ) {
        data class Function(
            val name: String,
            val arguments: String
        )
    }

    data class Logprobs(
        val content: List<ContentItem>?
    ) {
        data class ContentItem(
            val token: String,
            val logprob: Double,
            val bytes: List<Int>?,
            val top_logprobs: List<TopLogprob>?
        ) {
            data class TopLogprob(
                val token: String,
                val logprob: Double,
                val bytes: List<Int>?
            )
        }
    }

    data class Usage(
        val completion_tokens: Int,
        val prompt_tokens: Int,
        val prompt_cache_hit_tokens: Int,
        val prompt_cache_miss_tokens: Int,
        val total_tokens: Int,
        val completion_tokens_details: CompletionTokensDetails
    ) {
        data class CompletionTokensDetails(
            val reasoning_tokens: Int
        )
    }
}
